home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Tools⁄Additions / MacsbugBook / MacsBug Book Disk / Sample Application Sources / •BigEasy / BigEasy2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-04  |  3.3 KB  |  151 lines  |  [TEXT/KAHL]

  1. /* file: BigEasy2.h
  2.  *
  3.  * A set of routines to allow the quick development
  4.  * of simple Macintosh applications.
  5.  *
  6.  */
  7.  
  8. #ifndef BigEasyIncludes
  9. #define BigEasyIncludes
  10.  
  11. /************************************
  12. * Simple things
  13. ************************************/
  14.  
  15. typedef char s8;
  16. typedef unsigned char u8;
  17. typedef short s16;
  18. typedef unsigned short u16;
  19. typedef long s32;
  20. typedef unsigned long u32;
  21.  
  22. typedef void (*FP)();        /* Function Pointer */
  23.  
  24. typedef struct DitlItem
  25. {
  26.     long            placeholder;
  27.     Rect            displayRect;
  28.     unsigned char    type;
  29.     char            title[1];
  30. } DitlItem;
  31. typedef DitlItem *        DItemPtr;
  32.  
  33. typedef    struct
  34. {
  35.     int                count;
  36.     DitlItem        item[1];
  37. } Ditl;
  38. typedef Ditl *            DitlPtr;
  39. typedef    DitlPtr *        DitlHndl;
  40.  
  41.  
  42. #ifndef graphicsTypesIncludes
  43.     typedef Boolean boolean;
  44.     #define nil (0L)
  45. #endif
  46.  
  47. #define SwapShort(a,b) {short temp; temp = a; a = b; b = temp;}
  48.  
  49. #ifdef applec        /* to kill apple c unused var warnings */
  50.     #define UseVar(x) gXyzzyBucket = (long)x;
  51. #else
  52.     #define UseVar(x)
  53. #endif
  54.  
  55. /************************************
  56. * BigEasy2 Public Global Variables
  57. ************************************/
  58. #ifdef BigEasy2
  59.     #define VAR
  60. #else
  61.     #define VAR extern
  62. #endif
  63.  
  64. VAR boolean gQuitApp;
  65. VAR boolean gMenuNeedsCmdKey;
  66. VAR boolean gStaggerWindows;
  67. VAR short gLastModifiers;
  68.  
  69.  
  70. VAR Rect gBigRect;
  71.  
  72. #ifdef applec
  73.     VAR long gXyzzyBucket;                /* place to use variables    */
  74. #endif
  75.  
  76. #undef VAR
  77.  
  78. /************************************
  79. * Major BigEasy2 Routines
  80. ************************************/
  81.  
  82. WindowPtr InstallWindow(short iNum,s8 *iTitle,Rect *iRect,short iType,boolean iGrow,
  83.         FP iUpdate,FP iClick,FP iKey,FP iGoAway,
  84.         FP iActivate,FP iDeactivate,FP iIdle, boolean color);
  85.  
  86. void UninstallWindow(short iNum);
  87.  
  88. void Show(short inum);
  89. void Hide(short iNum);
  90. void InvalSubport(short wNum,short iNum);
  91. void InvalSubports(short wNum,s32 ref);
  92.  
  93. void InstallMenu(char s[],FP action,short ref);
  94. void InstallItem(char s[],FP action,short ref);
  95. void SetMenuItem(short ref,char enable,char isMarked,char mark,char s[]);
  96. void EnDisEdits(short Eundo,short Ecut,short Ecopy,short Epaste,short Eclear);
  97. void InstallEditMenu(FP,FP,FP,FP,FP);
  98.  
  99. void SetMasterIdle(FP);
  100.  
  101. short SetSubport(short wNum,short aSub,Rect *r);
  102. void GetWindowRect(short n,Rect *r);
  103. WindowPtr GetWindowPtr(short n);
  104. boolean GetWindowVisible(short n);
  105. void Replace1Resource(Handle,s32 type,short id);
  106. void SaveWindowPosition(short n);
  107. void ForgetWindowPosition(short n);
  108.  
  109. void GoWatch(void);
  110. void GoCursor(short c);
  111.  
  112. void FailNil(long);
  113. void FailOSErr(long);
  114.  
  115. /************************************
  116. * Client Provided BigEasy2 Routines
  117. ************************************/
  118.  
  119. void Bootstrap(void);
  120. void Hatstrap(void);
  121.  
  122. /************************************
  123. * Major BigEasy2 Structures
  124. ************************************/
  125.  
  126. typedef struct tWindowObject
  127. {
  128.     boolean wUsed;                        /* is this object used (in BigEasy's list)?    */
  129.     boolean wGrowable;
  130.     FP wUpdateProc;
  131.     FP wClickProc;
  132.     FP wKeyProc;
  133.     FP wGoAwayProc;
  134.     FP wActivateProc;
  135.     FP wDeactivateProc;
  136.     FP wIdleProc;
  137.     WindowPtr wWindow;
  138. } tWindowObject;
  139.  
  140.  
  141. /************************************
  142. * Minor BigEasy2 Hacks
  143. ************************************/
  144. #ifndef BigEasy2
  145.     #define FailNil(x)    FailNil((long)(x))                    /* Simulate a typeless call            */
  146.     #define FailOSErr(x)    FailOSErr((long)(x))            /* Simulate a typeless call            */
  147. #endif
  148.  
  149. #define Ticks (*(long *)0x16a)
  150.  
  151. #endif